CREATE TABLE [dbo].[TMEMPR]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[DE_NOMB] [dbo].[TD_VC_050] NOT NULL,
[DE_NOMB_CORT] [dbo].[TD_VC_020] NOT NULL,
[CO_GIRO] [dbo].[TD_VC_003] NOT NULL,
[DE_DIRE] [dbo].[TD_VC_100] NULL,
[CO_UBIC_GEOG] [dbo].[TD_VC_006] NOT NULL,
[CO_PAIS] [dbo].[TD_VC_003] NOT NULL,
[NO_DEPA] [dbo].[TD_VC_020] NULL,
[NO_PROV] [dbo].[TD_VC_020] NULL,
[DE_CODI_POST] [dbo].[TD_VC_010] NULL,
[NU_TLF1] [dbo].[TD_VC_020] NULL,
[NU_TLF2] [dbo].[TD_VC_020] NULL,
[NU_FAXS] [dbo].[TD_VC_020] NULL,
[NU_RUCS] [dbo].[TD_VC_020] NULL,
[DE_DIRE_WEBS] [dbo].[TD_VC_050] NULL,
[DE_DIRE_MAIL] [dbo].[TD_VC_050] NULL,
[CO_MONE_NACI] [dbo].[TD_VC_003] NOT NULL,
[NU_CERT_INSC] [dbo].[TD_VC_020] NULL,
[NU_REGI_PUBL] [dbo].[TD_VC_020] NULL,
[NU_LICE_MUNI] [dbo].[TD_VC_020] NULL,
[NO_REPR_LEGA] [dbo].[TD_VC_050] NULL,
[NO_GERE_GRAL] [dbo].[TD_VC_050] NULL,
[ST_PLAN] [dbo].[TD_VC_001_SINO] NULL,
[ST_CONT] [dbo].[TD_VC_001_SINO] NULL,
[ST_TESO] [dbo].[TD_VC_001_SINO] NULL,
[ST_LOGI] [dbo].[TD_VC_001_SINO] NULL,
[ST_VENT] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_PROD] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_ACTI] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_PRES] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_SIS1] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_SIS2] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_SIS3] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_SIS4] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ST_SIS5] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NV_INFO_OSER] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TMEMPR__NV_INFO___7D439ABD] DEFAULT ((0)),
[NV_QUIE_OSER] [dbo].[TD_VC_050] NULL,
[DE_RUTA_LOGO] [dbo].[TD_VC_200] NULL,
[TI_DOID_REPR] [dbo].[TD_VC_003] NULL,
[NU_DOID_REPR] [dbo].[TD_VC_020] NULL,
[TI_DOID_GERE] [dbo].[TD_VC_003] NULL,
[NU_DOID_GERE] [dbo].[TD_VC_020] NULL,
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[CO_REGI_LABO] [dbo].[TD_VC_003] NULL,
[FE_INSC] [dbo].[TD_DT_001] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMEMPR__CO_USUA___7E37BEF6] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMEMPR__FE_USUA___7F2BE32F] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMEMPR__CO_USUA___00200768] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMEMPR__FE_USUA___01142BA1] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_ACTI__76969D2E] CHECK NOT FOR REPLICATION (([ST_ACTI]='N' OR [ST_ACTI]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_CONT__71D1E811] CHECK NOT FOR REPLICATION (([ST_CONT]='N' OR [ST_CONT]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_LOGI__73BA3083] CHECK NOT FOR REPLICATION (([ST_LOGI]='N' OR [ST_LOGI]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_PLAN__70DDC3D8] CHECK NOT FOR REPLICATION (([ST_PLAN]='N' OR [ST_PLAN]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_PRES__778AC167] CHECK NOT FOR REPLICATION (([ST_PRES]='N' OR [ST_PRES]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_PROD__75A278F5] CHECK NOT FOR REPLICATION (([ST_PROD]='N' OR [ST_PROD]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_SIS1__787EE5A0] CHECK NOT FOR REPLICATION (([ST_SIS1]='N' OR [ST_SIS1]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_SIS2__797309D9] CHECK NOT FOR REPLICATION (([ST_SIS2]='N' OR [ST_SIS2]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_SIS3__7A672E12] CHECK NOT FOR REPLICATION (([ST_SIS3]='N' OR [ST_SIS3]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_SIS4__7B5B524B] CHECK NOT FOR REPLICATION (([ST_SIS4]='N' OR [ST_SIS4]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_SIS5__7C4F7684] CHECK NOT FOR REPLICATION (([ST_SIS5]='N' OR [ST_SIS5]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_TESO__72C60C4A] CHECK NOT FOR REPLICATION (([ST_TESO]='N' OR [ST_TESO]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] WITH NOCHECK ADD CONSTRAINT [CK__TMEMPR__ST_VENT__74AE54BC] CHECK NOT FOR REPLICATION (([ST_VENT]='N' OR [ST_VENT]='S'))
GO
ALTER TABLE [dbo].[TMEMPR] ADD CONSTRAINT [PK__TMEMPR__17D9AB4705F8DC4F] PRIMARY KEY CLUSTERED  ([CO_EMPR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMEMPR] ADD CONSTRAINT [FK__TMEMPR__CO_GIRO__384F51F2] FOREIGN KEY ([CO_GIRO]) REFERENCES [dbo].[TTGIRO_EMPR] ([CO_GIRO])
GO
ALTER TABLE [dbo].[TMEMPR] ADD CONSTRAINT [FK__TMEMPR__CO_MONE___375B2DB9] FOREIGN KEY ([CO_MONE_NACI]) REFERENCES [dbo].[TTMONE] ([CO_MONE])
GO
ALTER TABLE [dbo].[TMEMPR] ADD CONSTRAINT [FK__TMEMPR__CO_PAIS__3A379A64] FOREIGN KEY ([CO_PAIS]) REFERENCES [dbo].[TTPAIS] ([CO_PAIS])
GO
ALTER TABLE [dbo].[TMEMPR] ADD CONSTRAINT [FK__TMEMPR__CO_UBIC___3B2BBE9D] FOREIGN KEY ([CO_UBIC_GEOG]) REFERENCES [dbo].[TTUBIC_GEOG] ([CO_UBIC_GEOG])
GO
ALTER TABLE [dbo].[TMEMPR] ADD CONSTRAINT [FK__TMEMPR__TI_SITU__3943762B] FOREIGN KEY ([TI_SITU]) REFERENCES [dbo].[TTSITU] ([TI_SITU])
GO
GRANT SELECT ON  [dbo].[TMEMPR] TO [public]
GRANT INSERT ON  [dbo].[TMEMPR] TO [public]
GRANT DELETE ON  [dbo].[TMEMPR] TO [public]
GRANT UPDATE ON  [dbo].[TMEMPR] TO [public]
GO
